package com.lhh.springcloud.Controller;

import com.lhh.entity.Result;
import com.lhh.springcloud.service.MemberOpenFeignService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 李洪豪
 * @Sno 20220301044
 */
@RestController
public class MemberConsumerOpenFeignController {
    @Resource
    MemberOpenFeignService memberOpenFeignService;
    // //将来请求的就是http://VIPMEMBER-SERVICE-PROVIDER/member/query/{id}
    //    //VIPMEMBER-SERVICE-PROVIDER为服务提供方的名字，yaml文件中配置的(10001,10002)
    //    @GetMapping("/member/query/{id}")
    //    public Result queryMemberById(@PathVariable("id") Long id);
    //}
    @GetMapping("/member/openfeign/query/{id}")
    public Result queryMemberById(@PathVariable("id") Long id) {
        return memberOpenFeignService.queryMemberById(id);
    }

}
